#include <zenilib.h>
#include "Sprite.h"

SpriteObject::SpriteObject(Vector2 pos_, Vector2 scale_) :
	GameObject(pos_, scale_),
	textureChangeElapsedTime(0),
	textureNum(0),
	moving(false),
	preTexture(""),
	platform(NULL),
	deadTime(0),
	gone(false)
{
	mass = poly.calculateMass(0.5f); //0.5f is density on scale 0 to 1
	inertia = poly.calculateInertia();
	accel = Vector2(0, 500);
}

void SpriteObject::checkPlatform()
{
	//determine if walked off platform
	if (platform && (right() < platform->left() || left() > platform->right())){
		platform = NULL;
	}
}